﻿using Net5ApiANdWpfClient.Lib.Common;
using Net5ApiANdWpfClient.Lib.Model;
using Net5ApiANdWpfClient.Lib.Model.SystemAdmin;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Net5ApiANdWpfClient.Lib.Service
{
    public class ModuleService
    {
        private static List<ModuleView> menuList;
        public static List<ModuleView> MenuList
        { get {
                if (menuList == null) menuList = GetModuleViewsAll();
                return menuList;
            }  }
        public static List<ModuleView> GetModuleViewsAll()
        {
            List<ModuleView> modulesList = new List<ModuleView>();

            //基础
            ModuleView basicMnager = new ModuleView()
            {
                module_code = "basicInfomation",
                module_name = "基础"
            };
            modulesList.Add(basicMnager);
            basicMnager.SonModuleList = new List<ModuleView>()
            {
                new ModuleView{
                    module_code = "carManage",
                    module_name = "车辆管理"
                },
                new ModuleView{
                    module_code = "shipperManage",
                    module_name = "货主管理"
                },
                new ModuleView{
                    module_code = "OutsourceManager",
                    module_name = "外协单位管理",
                    winform_type="WpfClient.OutsourceManger.ShowOutsource"
                },
                new ModuleView{
                    module_code = "oilCostManage",
                    module_name = "油费管理"
                },
                new ModuleView{
                    module_code = "lineManage",
                    module_name = "线路管理",
                    winform_type="WpfClient.LineManager.ShowLine"
                }
            };

            //人事
            ModuleView personnelManger = new ModuleView()
            {
                module_code = "personnelManger",
                module_name = "人事"
            };
            modulesList.Add(personnelManger);
            personnelManger.SonModuleList = new List<ModuleView>()
            {
                new ModuleView{
                    module_code = "personnelBoard",
                    module_name = "人事看板"
                },
                new ModuleView{
                    module_code = "employeeRegistration",
                    module_name = "员工登记"
                },
                new ModuleView{
                    module_code = "entryTransaction",
                    module_name = "入职办理"
                },
                new ModuleView{
                    module_code = "dimissionTransaction",
                    module_name = "离职办理"
                },
                new ModuleView{
                    module_code = "positiveManage",
                    module_name = "转正管理"
                }
            };

            //合同
            ModuleView contractManage = new ModuleView()
            {
                module_code = "contractManage",
                module_name = "合同"
            };
            modulesList.Add(contractManage);
            contractManage.SonModuleList = new List<ModuleView>()
            {
                new ModuleView{
                    module_code = "ownerContractManage",
                    module_name = "货主合同管理"
                },
                new ModuleView{
                    module_code = "carrierContractManage",
                    module_name = "承运合同管理"
                },
                new ModuleView{
                    module_code = "generalContractManage",
                    module_name = "通用合同管理"
                }
            };

            //结算
            ModuleView balanceManger = new ModuleView()
            {
                module_code = "balanceManger",
                module_name = "结算"
            };
            modulesList.Add(balanceManger);
            balanceManger.SonModuleList = new List<ModuleView>()
            {
                new ModuleView{
                    module_code = "receivableCostManage",
                    module_name = "应收费用管理"
                },
                new ModuleView{
                    module_code = "handleCostManage",
                    module_name = "应付费用管理"
                },
                new ModuleView{
                    module_code = "incomeInvoiceManage",
                    module_name = "进项发票管理"
                },
                new ModuleView{
                    module_code = "outputInvoiceManage",
                    module_name = "销项发票管理"
                }
            };

            //物资
            ModuleView materials = new ModuleView()
            {
                module_code = "materials",
                module_name = "物资"
            };
            modulesList.Add(materials);
            materials.SonModuleList = new List<ModuleView>()
            {
                new ModuleView{
                    module_code = "materialsPurchasing",
                    module_name = "物资采购"
                },
                new ModuleView{
                    module_code = "stockManage",
                    module_name = "入库管理"
                },
                new ModuleView{
                    module_code = "materialReceive",
                    module_name = "物资领用"
                },
                new ModuleView{
                    module_code = "materialStatistics",
                    module_name = "物资统计"
                },
                new ModuleView{
                    module_code = "refundManage",
                    module_name = "报销管理"
                },
                new ModuleView{
                    module_code = "paymentManage",
                    module_name = "付款管理"
                }
            };

            //维护
            ModuleView safeguard = new ModuleView()
            {
                module_code = "safeguard",
                module_name = "维护"
            };
            modulesList.Add(safeguard);
            safeguard.SonModuleList = new List<ModuleView>()
            {
                new ModuleView{
                    module_code = "maintainRecord",
                    module_name = "维修记录"
                },
                new ModuleView{
                    module_code = "upkeepRecord",
                    module_name = "保养记录"
                },
                new ModuleView{
                    module_code = "breakrulesRecord",
                    module_name = "违章记录"
                },
                new ModuleView{
                    module_code = "accidentRecord",
                    module_name = "事故记录"
                },
                new ModuleView{
                    module_code = "tireuseRecord",
                    module_name = "轮胎使用记录"
                },
                new ModuleView{
                    module_code = "costRecord",
                    module_name = "费用记录"
                }
            };

            //跟踪
            ModuleView track = new ModuleView()
            {
                module_code = "track",
                module_name = "跟踪"
            };
            modulesList.Add(track);
            track.SonModuleList = new List<ModuleView>()
            {
                new ModuleView{
                    module_code = "ownerContractTrack",
                    module_name = "货主合同跟踪"
                },
                new ModuleView{
                    module_code = "carrierContractTrack",
                    module_name = "承运合同跟踪"
                }
            };

            //审批
            ModuleView approval = new ModuleView()
            {
                module_code = "approval",
                module_name = "审批"
            };
            modulesList.Add(approval);
            approval.SonModuleList = new List<ModuleView>()
            {
                new ModuleView{
                    module_code = "ownerContractApproval",
                    module_name = "货主合同审批"
                },
                new ModuleView{
                    module_code = "carrierContractApproval",
                    module_name = "承运合同审批"
                },
                new ModuleView{
                    module_code = "generalContractApproval",
                    module_name = "通用合同审批"
                },
                new ModuleView{
                    module_code = "materialsPurchasingApproval",
                    module_name = "物资采购审批"
                },
                new ModuleView{
                    module_code = "materialReceiveApproval",
                    module_name = "物资领用审批"
                },
                new ModuleView{
                    module_code = "refundApproval",
                    module_name = "报销审批"
                },
                new ModuleView{
                    module_code = "paymentApproval",
                    module_name = "付款审批"
                },
                new ModuleView{
                    module_code = "entryApproval",
                    module_name = "入职审批"
                },
                new ModuleView{
                    module_code = "dimissionApproval",
                    module_name = "离职审批"
                },
                new ModuleView{
                    module_code = "positiveApproval",
                    module_name = "转正审批"
                }
            };

            //设置
            ModuleView systemManger = new ModuleView()
            {
                module_code = "systemManger",
                module_name = "设置"
            };
            modulesList.Add(systemManger);
            systemManger.SonModuleList = new List<ModuleView>()
            {
                new ModuleView{
                    module_code = "basicInfomationSettings",
                    module_name = "基础信息设置"
                },
                new ModuleView{
                    module_code = "operatorManage",
                    module_name = "操作员管理",
                    winform_type= "WpfClient.SystemManger.OperatorManager"
                },
                new ModuleView{
                    module_code = "roleManage",
                    module_name = "角色管理"
                },
                new ModuleView{
                    module_code = "departmentManage",
                    module_name = "部门管理"
                },
                new ModuleView{
                    module_code = "positionManage",
                    module_name = "职位管理",
                    winform_type="WpfClient.SystemManger.positioninfo"
                }
            };

            return modulesList;
        }

       
    }
}
